// 定义模型(表book 书)
const sequelize = require('./db')
const { DataTypes } = require('sequelize')

const Book = sequelize.define('Book', {

    name: {
        type: DataTypes.STRING,
        allowNull: false,
    },
    imgUrl: {
        type: DataTypes.STRING,
        allowNull: false,
    },
    publishDate: {
        type: DataTypes.DATE,
        allowNull: false,
    },
    auther: {
        type: DataTypes.STRING,
        allowNull: false,
    }

}, {
    createdAt: 'create_time',
    updatedAt: 'update_time',
    paranoid: true
})

module.exports = Book